<?
$past_illness = set_value('past_illness',$student->hhc_past_illness);
$frequent_colds = set_value('frequent_colds',$student->hhc_frequent_colds);
$frequent_headaches = set_value('frequent_headaches',$student->hhc_frequent_headaches);
$frequent_stomachaches = set_value('frequent_stomachaches',$student->hhc_frequent_stomachaches);
$frequent_dizziness = set_value('frequent_dizziness',$student->hhc_dizziness);
$frequent_vommiting = set_value('frequent_vommiting',$student->hhc_vomitting);
$major_operations = set_value('major_operations',$student->hhc_major_operations_specify);
$major_injury = set_value('major_injury',$student->hhc_major_injury_specify);
$major_ailment = set_value('major_ailment',$student->hhc_diagnosed_specify);
$medication_child_taking = set_value('medication_child_taking',$student->hhc_medication);
$medication_allergy = set_value('medication_allergy',$student->hhc_alergic_med);
$child_eating_habbit = set_value('child_eating_habbit',$student->hhc_general_eating);
$dietary_restrictions = set_value('dietary_restrictions',$student->hhc_food_restrictions);
$school_help_eating_habbit = set_value('school_help_eating_habbit',$student->hhc_school_help_eating);

//CHECK if value updated , if yes check if approve, denied  or pending
/*
 * Function located at parent_helper
 */

$profile_request = isset($profile_request) ? $profile_request : false;
$req_id = isset($req_id) ? $req_id : 0;

$is_past_illness = req_check_if_updated($req_id, 'hhc_past_illness',$student->hhc_past_illness, $profile_request);
$is_frequent_colds = req_check_if_updated($req_id, 'hhc_frequent_colds',$student->hhc_frequent_colds, $profile_request);
$is_frequent_headaches = req_check_if_updated($req_id, 'hhc_frequent_headaches',$student->hhc_frequent_headaches, $profile_request);
$is_frequent_stomachaches = req_check_if_updated($req_id, 'hhc_frequent_stomachaches',$student->hhc_frequent_stomachaches, $profile_request);
$is_frequent_dizziness = req_check_if_updated($req_id, 'hhc_dizziness',$student->hhc_dizziness, $profile_request);
$is_frequent_vommiting = req_check_if_updated($req_id, 'hhc_vomitting',$student->hhc_vomitting, $profile_request);
$is_major_operations = req_check_if_updated($req_id, 'hhc_major_operations_specify',$student->hhc_major_operations_specify, $profile_request);
$is_major_injury = req_check_if_updated($req_id, 'hhc_major_injury_specify',$student->hhc_major_injury_specify, $profile_request);
$is_major_ailment = req_check_if_updated($req_id, 'hhc_diagnosed_specify',$student->hhc_diagnosed_specify, $profile_request);
$is_medication_child_taking = req_check_if_updated($req_id, 'hhc_medication',$student->hhc_medication, $profile_request);
$is_medication_allergy = req_check_if_updated($req_id, 'hhc_alergic_med',$student->hhc_alergic_med, $profile_request);
$is_child_eating_habbit = req_check_if_updated($req_id, 'hhc_general_eating',$student->hhc_general_eating, $profile_request);
$is_dietary_restrictions = req_check_if_updated($req_id, 'hhc_food_restrictions',$student->hhc_food_restrictions, $profile_request);
$is_school_help_eating_habbit = req_check_if_updated($req_id, 'hhc_school_help_eating',$student->hhc_school_help_eating, $profile_request);
?>
<div>
		<?=form_open('',' class="custom profile_form" id ="health_history" ')?>
		<div>
			<label class="radius secondary label">What PAST ILLNESSES has the child had?<br>(Please enumerate and specify age it occured)</label> <?=$is_past_illness->checkbox?>
			<?=form_error('past_illness');?>
			<textarea class="<?=$is_past_illness->changed ? $is_past_illness->class : '' ?>" name="past_illness"><?=$past_illness;?></textarea>
		</div>
	<fieldset>
		<legend class="radius secondary label">How frequent does the child have the following?</legend>
		<div>
			<label class="radius secondary label">COLDS</label> <?=$is_frequent_colds->checkbox?>
			<?=form_error('frequent_colds');?>
			<input class="<?=$is_frequent_colds->changed ? $is_frequent_colds->class : '' ?>" type="text" name="frequent_colds" value="<?=$frequent_colds;?>">
		</div>
		<div>
			<label class="radius secondary label">HEADACHES</label> <?=$is_frequent_headaches->checkbox?>
			<?=form_error('frequent_headaches');?>
			<input class="<?=$is_frequent_headaches->changed ? $is_frequent_headaches->class : '' ?>" type="text" name="frequent_headaches" value="<?=$frequent_headaches;?>">
		</div>
		<div>
			<label class="radius secondary label">STOMACH ACHES</label> <?=$is_frequent_stomachaches->checkbox?>
			<?=form_error('frequent_stomachaches');?>
			<input class="<?=$is_frequent_stomachaches->changed ? $is_frequent_stomachaches->class : '' ?>" type="text" name="frequent_stomachaches" value="<?=$frequent_stomachaches;?>">
		</div>
		<div>
			<label class="radius secondary label">DIZZINESS</label> <?=$is_frequent_dizziness->checkbox?>
			<?=form_error('frequent_dizziness');?>
			<input class="<?=$is_frequent_dizziness->changed ? $is_frequent_dizziness->class : '' ?>" type="text" name="frequent_dizziness" value="<?=$frequent_dizziness;?>">
		</div>
		<div>
			<label class="radius secondary label">VOMMITING</label> <?=$is_frequent_vommiting->checkbox?>
			<?=form_error('frequent_vommiting');?>
			<input class="<?=$is_frequent_vommiting->changed ? $is_frequent_vommiting->class : '' ?>" type="text" name="frequent_vommiting" value="<?=$frequent_vommiting;?>">
		</div>
	</fieldset>

	<div>
		<label class="radius secondary label">Has your child had any major operations? if yes specify</label> <?=$is_major_operations->checkbox?>
		<?=form_error('major_operations');?>
		<textarea class="<?=$is_major_operations->changed ? $is_major_operations->class : '' ?>" name="major_operations"><?=$major_operations;?></textarea>
	</div>
	<div>
		<label class="radius secondary label">Has your child had any major injury in the past? <br>(eg. limbs,joints,head,spine) specify</label> <?=$is_major_injury->checkbox?>
		<?=form_error('major_injury');?>
		<textarea class="<?=$is_major_injury->changed ? $is_major_injury->class : '' ?>" name="major_injury"><?=$major_injury;?></textarea>
	</div>
	<div>
		<label class="radius secondary label">Has your child been diagnosed with any major ailment<br>(eg. heart,epilepsy,asthma) if Yes specify</label> <?=$is_major_ailment->checkbox?>
		<?=form_error('major_ailment');?>
		<textarea class="<?=$is_major_ailment->changed ? $is_major_ailment->class : '' ?>" name="major_ailment"><?=$major_ailment;?></textarea>
	</div>
	<div>
		<label class="radius secondary label">What medication/remedy is your child taking?</label> <?=$is_medication_child_taking->checkbox?>
		<?=form_error('medication_child_taking');?>
		<input class="<?=$is_medication_child_taking->changed ? $is_medication_child_taking->class : '' ?>" type="text" name="medication_child_taking" value="<?=$medication_child_taking;?>">
	</div>
	<div>
		<label class="radius secondary label">Is your child allergic to Penicillin? Aspirin? other mediaciton specify?</label> <?=$is_medication_allergy->checkbox?>
		<?=form_error('medication_allergy');?>
		<input class="<?=$is_medication_allergy->changed ? $is_medication_allergy->class : '' ?>" type="text" name="medication_allergy" value="<?=$medication_allergy;?>">
	</div>
	<div>
		<label class="radius secondary label">What is the general eating habbit of the child?</label> <?=$is_child_eating_habbit->checkbox?>
		<?=form_error('child_eating_habbit');?>
		<input class="<?=$is_child_eating_habbit->changed ? $is_child_eating_habbit->class : '' ?>" type="text" name="child_eating_habbit" value="<?=$child_eating_habbit;?>">
	</div>
	<div>
		<label class="radius secondary label">Are there any DIETARY RESTRICTIONS or FOOD ALLERGIES? if yes Specify</label> <?=$is_dietary_restrictions->checkbox?>
		<?=form_error('dietary_restrictions');?>
		<input class="<?=$is_dietary_restrictions->changed ? $is_dietary_restrictions->class : '' ?>" type="text" name="dietary_restrictions" value="<?=$dietary_restrictions;?>">
	</div>
	<div>
		<label class="radius secondary label">How do you want the school to help in his/her eating habit?</label> <?=$is_school_help_eating_habbit->checkbox?>
		<?=form_error('school_help_eating_habbit');?>
		<input class="<?=$is_school_help_eating_habbit->changed ? $is_school_help_eating_habbit->class : '' ?>" type="text" name="school_help_eating_habbit" value="<?=$school_help_eating_habbit;?>">
	</div>
	<?/*if(isset($student->edit) && $student->edit === 1):?>
		<div>
			<input type="hidden" name="profile_id" value="<?=$student->profile_id;?>">
			<input type="hidden" name="enrollment_id" value="<?=$student->enrollment_id;?>">
			<input type="hidden" name="update_health_history" value="true">
			<input type="submit" name="update_health_history" value="Update Health History"  class="btn btn-primary">
		</div>
	<?endif*/?>
	</form>
</div>